﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using MethodWorx.CMS.Content;
using MethodWorx.CMS.Services;
using MethodWorx.Core.Validation;
using MethodWorx.Core.DomainModel;
using MethodWorx.CMS.Workflow;

namespace MethodWorx.CMS.Requests
{
    public class WorkflowRequest
    {
        public WorkflowRequest(Page page)
        {
            this.Page = page;
        }

        public WorkflowRequest(Page page, WorkflowConfiguration workflow)
        {
            this.Page = page;
            this.Name = workflow.Name;
            this.InvokeOnHttpMethod = workflow.InvokeOnHttpMethod;
            this.Shared = workflow.Shared;
            this.InvokeOnPageEvent = workflow.InvokeOnPageEvent;
            this.OriginalName = workflow.Name;
        }

        [Required]
        public string Name { get; set; }

        public string OriginalName { get; set; }

        public string InvokeOnHttpMethod { get; set; }
        public string InvokeOnPageEvent { get; set; }

        public Page Page { get; set; }

        public bool Shared { get; set; }
    }
}
